
/**
 * Created by seeker910 on 2014/8/28.
 * @description 组件名称命名约定：继承container组件，名称以ViewPart结尾;继承control组件，名称以Part结尾
 * src + title + text
 */
Rsd.define('Rsd.hermit.sections.ImageContentPart', {
    extend: 'Rsd.form.Image',
    requires: [ 
        'Rsd.form.Text',
        'Rsd.form.Label'
    ],
    xtype: 'image-content',
    domEditable:true,
     /**
     * @description true:表示只允许在模板中修改
     */
    editInMaster:false,
    width:'100%',
    label: {
        position: 'bottom',
        space: 0,
        width: '100%',
        height: 100,
        xtype: 'container',
        header:false,
        layout:'vbox',
        style:{display:'flex',justifyContent:'center'},
        items:[
            {
                xtype:'label',
                label:false,
                 width: '100%',
                ctrlTagName: 'h2'
            },
            {
                xtype:'label',
                label:false,  
                 width: '100%',
                height: '60px', 
                style: {
                    color: 'grey'
                }
            },
        ] 
    }, 
   
    /**
     * {
     *     title:'Title',
           text:'Sub Title',
           src:""
     * }
     */
    dataSource:{},
    /**
     * 
     * @param {*} config 
     */
    constructor: function ImageContentPart(config) {
        config = config || {};
        Rsd.apply(this, config); 
    },
    /**
     * 
     */
    loadData:function loadData(dataSource)
    {
        this.dataSource = dataSource||this.dataSource||{};
        this.label.content.items[0].setText(this.dataSource.title||'');
        this.label.content.items[1].setText(this.dataSource.text||'');
        this.setSrc(this.dataSource.src);
    }

});



